package com.ljf.tijian.config;

import com.ljf.tijian.interceptor.JWTInterceptor;
import com.ljf.tijian.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class TijianWebInterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/**").order(10)
                .excludePathPatterns("/login","register");

        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login","/register","/queryOrderPage","/createReportTemplate",
                        "/checkItemDetailedBySmId","/getdetaileddata","/updateReportData","/updateordersstate",
                        "/getSetmeals","/ai/kimi",
                        "/getoverallresult","/updateoverallresult","/deleteoverallresult","/addoverallresult").order(20);
    }
}
